<include file="Public:header"/>

<div class="table-tit">
    订单流水列表
    <select class="pull-right" onchange="getselect(this.value);">
        <option value="">请选择</option>
        <option value="0" <if condition="$ods eq 0">selected</if>>等待支付</option>
        <option value="1" <if condition="$ods eq 1">selected</if>>有效推广</option>
        <option value="4" <if condition="$ods eq 4">selected</if>>无效推广</option>
    </select>
</div>
<table class="table table-bgfont">
    <tr>
        <th width="12%">订单编号</th>
        <th>客户</th>
        <th>优惠金额</th>
        <th>应付金额</th>
        <th>实际金额</th>
        <th>下单时间</th>
        <th>支付时间</th>
        <th>订单状态</th>
        <th>管理</th>
    </tr>
    
    <volist name="data.data" id="v">
        <tr>
            <td>{$v.ord_sn}</td>
            <td>{$v.ord_userid|getUserName=$v['ord_userid'],###}</td>
            <td>{$v.ord_discount}</td>
            <td>{$v.ord_amount}</td>
            <td>{$v['ord_amount']+$v['ord_discount']}</td>
            <td>{$v.ord_addtime|date='Y-m-d H:i:s',###}</td>
            <td>{$v.ord_paytime|date='Y-m-d H:i:s',###}</td>
            <td>
                <switch name='v.ord_status'>
                <case value="0"><button type="button" class="btn btn-warning btn-xs">等待支付</button></case>
                <case value="1"><button type="button" class="btn btn-success btn-xs">有效推广</button></case>
                <case value="2"><button type="button" class="btn btn-success btn-xs">有效推广</button></case>
                <case value="3"><button type="button" class="btn btn-success btn-xs">有效推广</button></case>
                <case value="4"><button type="button" class="btn btn-danger btn-xs">无效推广</button></case>
                <case value="5"><button type="button" class="btn btn-danger btn-xs">无效推广</button></case>
                </switch>
            </td>
            <td>
                <a href="{:U('Dash/waterover','ors='.$v['ord_sn'])}">
                <button type="button" class="btn btn-info btn-xs">浏览</button>
                </a>
            </td>
        </tr>
    </volist>
    <tr>
        <td colspan="9">{$data.page}</td>
    </tr>
</table>

<script>
    function getselect(val){
        if(val.length!=0){
            window.location="__APP__/Analysis/Dash/water/ods/"+val+".html";
        }else{
            window.location="__APP__/Analysis/Dash/water.html";
        }
    }
</script>
<include file="Public:footer"/>